home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / text / tex / EVPaths140.lha / EVPaths.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  2KB  |  55 lines

  1. #ifndef EVPATHS_H
  2. #define EVPATHS_H
  3. /*
  4. ** $VER:  EVPaths.h 1.40 (03.05.95)
  5. **
  6. ** Header for EVPaths Routines.
  7. **
  8. ** Written by Giuseppe Ghibò
  9. **
  10. ** Copyright © 1994,1995 by Giuseppe Ghibò
  11. **
  12. */
  13. #include <exec/types.h>
  14. #include <dos/dos.h>
  15. #include <stdio.h>
  16.  
  17. struct EnvVarPath
  18. {
  19.     STRPTR name;
  20.  
  21.     union {
  22.         STRPTR *strings;
  23.         UBYTE *buffer;
  24.     } storage;
  25.  
  26.         STRPTR defpath;
  27.     LONG size;
  28.     LONG status;
  29.     LONG pos;
  30. };
  31.  
  32. /* Prototypes */
  33. GLOBAL LONG    __stdargs SNPrintf(STRPTR String, LONG Size, STRPTR FmtString, ...);
  34. GLOBAL LONG    __regargs GetVarLength(STRPTR envname);
  35.  
  36. GLOBAL struct EnvVarPath __regargs *Alloc_EnvVarPath(STRPTR varname, LONG size);
  37. GLOBAL VOID        __regargs Free_EnvVarPath(struct EnvVarPath *p);
  38. GLOBAL VOID        __regargs Init_EnvVarPath(struct EnvVarPath *p, APTR deflt_str, LONG mode);
  39. GLOBAL STRPTR        __regargs EVP_FileSearch(STRPTR filename, struct EnvVarPath *evp, UBYTE *buffer, LONG size);
  40. BPTR            __regargs EVP_Open(STRPTR filename, struct EnvVarPath *evp, UBYTE *buffer, LONG size, LONG mode);
  41. FILE *            __regargs EVP_fopen(STRPTR filename, struct EnvVarPath *evp, UBYTE *buffer, LONG size, char *mode);
  42.  
  43. #define ENVPATH_DEFSTR         (1L << 0)    /* default path provided as string */
  44. #define ENVPATH_DEFARR         (1L << 1)    /* default path provided as array of strings */
  45. #define ENVPATH_PREPEND_PATH    (1L << 31)    /* Prepend the default path */
  46. #define ENVPATH_APPEND_PATH    (1L << 30)    /* Append the default path */
  47. #define ENVPATH_CURRENTDIR_FIRST (1L << 29)    /* Search in current dir first */
  48. #define ENVPATH_BUFFER_EMPTY        0L /* buffer is empty */
  49. #define ENVPATH_BUFFER_COMPLETE        1L /* buffer is complete, i.e. no more entries */
  50. #define ENVPATH_BUFFER_FULL        2L /* buffer is full, i.e. not enough room for other entries */
  51. #define ENVPATH_BUFFER_TRUNC        3L /* buffer is truncated because a not enough memory was encountered during processing */
  52. #define ENVPATH_BUFFER_INCOMPLETE    4L /* there could be other entries, but actually aren't into the buffer */
  53.  
  54. #endif    /* EVPATHS_H */
  55.